<template>
	<view class="bmain">
		<view class="Bb">
		<view>
			<!-- 图片 -->
			<view class="bmix">
				<image src="https://obs-4a40.obs.cn-southwest-2.myhuaweicloud.com/shop/money.png" mode=""></image>
			</view>
			<!-- 余额 -->
			<view class="mybalance">
				<text>我的余额</text>
			</view>
			<!-- 金钱 -->
			<view class="mymoney">
				<text style="font-weight: bold;">￥{{Number(money).toFixed(2)}}</text>
			</view>
			
			<view class="history">
				<text style="color: #333333;font-size: 40rpx;font-weight: bold;" @click="go()">我的流水</text>
			</view>
			<view class="Withdrawal" @click="tixian()">
				<text>去提现</text>
			</view>
		</view>
		</view>
	</view>
</template>

<script>
		
	export default {
		data() {
			return {
				money:'',
			}
		},
		onLoad() {
			// 用户余额
			const requestMoney = {
				url: `/api/account/accountMoney`,
				method: "post",
				callBack: (res) => {
					this.text = 'request success';
					this.money=JSON.stringify(res.data.sumMoney)
					// console.log(this.money);
					
				}
			}
			this.$http.request(requestMoney)
		},

		methods: {
			go() {
				uni.navigateTo({
					url: './Money_history'
				})
			},
			tixian(){
				uni.navigateTo({
					url:'./drawal'
				})
			}
			
		}
		
	}
</script>

<style>
	.bmain {
		width: 100%;
		height: 100vh;
		background-color: #F1F1F1;

	}

	.Bb {
		padding: 200rpx 0 0rpx;
	}
	.bmix{
		margin: 0 auto 50rpx;
		width: 120rpx;
		height: 120rpx;
	}

	.bmix image {
		width: 120rpx;
		height: 120rpx;
	}

	.mybalance {
		color: #333333;
		font-size: 34rspx;
		margin-bottom:50rpx;
		text-align: center;
		font-weight: bold;
	}

	.mymoney {
		color: #333333;
		font-size: 80rpx;
		text-align: center;
	}

	.history {
		width: 710rpx;
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
		background-color: #FFFFFF;
		position: fixed;
		bottom: 40rpx;
		right: 20rpx;

	}

	.Withdrawal {
		width: 710rpx;
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
		background-color: #FCC100;
		position: fixed;
		bottom: 140rpx;
		right: 20rpx;
		color: #FFFFFF;
		font-size: 40rpx;
		font-weight: bold;
	}
</style>
